namespace Skymate.Lyjt.Core
{
    /*
     * 开始和结束标记也可以是两个或两个以上的字节
     */

    public static class ProtocolConst
    {
        public static readonly byte ByteEmpty = 0x00;

        public static readonly byte Version = 0x10;

        public static readonly byte Computer = 0x20;

        public static readonly byte LightController = 0x10;
        
        public static readonly byte[] BeginMark = { 0xC0 };

        public static readonly byte[] EndMark = { 0xC0 };

        public class DataLink
        {
            public static readonly byte Communication = 0x01;
            public static readonly byte Info = 0x02;
            public static readonly byte LatentParameter = 0x03;
            public static readonly byte Intervene = 0x03;
        }

        public class OptionType
        {
            /// <summary>
            /// 查询请求
            /// </summary>
            public const byte QueryRequest = 0x80;

            /// <summary>
            /// 设置请求
            /// </summary>
            public const byte SetRequest = 0x81;

            /// <summary>
            /// 主动上报
            /// </summary>
            public const byte ActiveReporting = 0x82;

            /// <summary>
            /// 查询应答
            /// </summary>
            public const byte QueryResponse = 0x83;

            /// <summary>
            /// 设置应答
            /// </summary>
            public const byte SetResponse = 0x84;

            /// <summary>
            /// 出错应答
            /// </summary>
            public const byte ErrorResponse = 0x85;
        }

        public class ObjectType
        {
            /// <summary>
            /// 联机
            /// </summary>
            public const byte Online = 0x01;

            /// <summary>
            /// 交通流
            /// </summary>
            public const byte TrafficFlow = 0x02;
            
            /// <summary>
            /// 信号机工作状态
            /// </summary>
            public const byte WorkState = 0x03;

            /// <summary>
            /// 红灯状态
            /// </summary>
            public const byte RedState = 0x04;

            /// <summary>
            /// 当前时间
            /// </summary>
            public const byte Datetime = 0x05;

            /// <summary>
            /// 信号灯组
            /// </summary>
            public const byte SignalLampGroup = 0x06;

            /// <summary>
            /// 相位
            /// </summary>
            public const byte Phase = 0x07;

            /// <summary>
            /// 信号配时方案
            /// </summary>
            public const byte SignalTimingScheme = 0x08;

            /// <summary>
            /// 工作调度计划
            /// </summary>
            public const byte ProjectSchedulingPlan = 0x09;

            /// <summary>
            /// 工作方式
            /// </summary>
            public const byte OperationMode = 0xA;

            /// <summary>
            /// 信号机故障
            /// </summary>
            public const byte Fault = 0x0B;

            /// <summary>
            /// 信号机版本
            /// </summary>
            public const byte SignalVersion = 0x0C;

            /// <summary>
            /// 特征参数
            /// </summary>
            public const byte Feature = 0x0D;

            /// <summary>
            /// 信号机识别码
            /// </summary>
            public const byte Distinguish = 0x0E;

            /// <summary>
            /// 远程控制
            /// </summary>
            public const byte RemoteControl = 0x0F;

            /// <summary>
            /// 检测器
            /// </summary>
            public const byte Detector = 0x20;
        }
    }
}